import { Action } from '@ngrx/store';

import { Poi, PlaceTextOption } from '../../../ngx-ol/models';

export enum PoisActionTypes {
    LOAD_POIS = '[Pois] Load Pois',
    LOAD_POIS_FAIL = '[Pois] Load Pois Fail',
    LOAD_POIS_SUCCESS = '[Pois] Load Pois Success',
    SELECT_POIS = '[Pois] Select Pois',
    Clear_POIS = '[Pois] Clear Pois'
}

export class LoadPois implements Action {
    readonly type = PoisActionTypes.LOAD_POIS;
    constructor(public payload: PlaceTextOption) {}
}

export class LoadPoisFail implements Action {
    readonly type = PoisActionTypes.LOAD_POIS_FAIL;
    constructor(public payload: any) {}
}

export class LoadPoisSuccess implements Action {
    readonly type = PoisActionTypes.LOAD_POIS_SUCCESS;
    constructor(public payload: Poi[]) {}
}

export class SelectPois implements Action {
    readonly type = PoisActionTypes.SELECT_POIS;
    constructor(public payload: Poi) {}
}

export class ClearPois implements Action {
    readonly type = PoisActionTypes.Clear_POIS;
}


export type PoisAction = LoadPois | LoadPoisFail | LoadPoisSuccess | SelectPois | ClearPois;

